<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>投诉信息列表</title>
    
    <link rel="stylesheet" type="text/css" href="css/commonStyle.css">
	
	<script type="text/javascript" src="dwr/engine.js" ></script>
	<script type="text/javascript" src="dwr/util.js" ></script>
	<script type="text/javascript" src="dwr/interface/complainAjax.js" ></script>
	<script type="text/javascript" src="js/JQuery.js" ></script>
	<script type="text/javascript" src="lhgdialog/lhgdialog.min.js" ></script>
	<script type="text/javascript" src="js/Calendar.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/complainList.js" ></script>
    
  </head>
  
  <body>
  <form action="Complain_queryByProperty.action" method="post">
  	<table class="fullTableStyle">
  		<thead>
  			<tr>
  				<td class="queryTableHead">按条件查询投诉信息：</td>
  			</tr>
  		</thead>
  		<tbody>
  			<tr>
  				<td>
  					受理人：<input type="hidden" name="userId" value="<s:property value='#request.userId' />" />
  					<input type="text" name="userName" onfocus="showUser()" value="<s:property value='#request.userName' />" />
  					投诉日期：<input type="text" name="time" onfocus="MyCalendar.SetDate(this)" value="<s:property value='#request.time' />" />
  					客户满意程度：
  					<select name="satisficationId">
  						<option value="0">--满意度--</option>
  						<s:iterator value="satisfications" var="satisfication">
  							<s:if test="#satisfication.name != ''">
	  							<option value="<s:property value='#satisfication.id' />" 
	  								<s:if test="#request.satisficationId == #satisfication.id">
	  									selected
	  								</s:if> 
	  							><s:property value="#satisfication.name" /></option>
  							</s:if>
  						</s:iterator>
  					</select>
  					处理状态：
  					<select name="stateId">
  						<option value="0">--处理状态--</option>
  						<s:iterator value="states" var="state">
  							<s:if test="#state.name != ''">
	  							<option value="<s:property value='#state.id' />" 
	  								<s:if test="#request.stateId == #state.id">
	  									selected
	  								</s:if>
	  							><s:property value="#state.name" /></option>
  							</s:if>
  						</s:iterator>
  					</select>
  					<input type="submit" value="" style="background: url('img/query.png');" class="queryLogo" />
  				</td>
  			</tr>
  		</tbody>
  	</table>
  </form>
  
  
    <table class="fullTableStyle">
    	<thead>
    		<tr class="theadNoTitle">
    			<td colspan="10"><span>投诉列表显示</span><a href="#" onclick="return showAddDialog()">&cong;添加投诉</a></td>
    		</tr>
    		<tr>
    			<td><input type="checkbox" onclick="checkAllComplains(this)" /></td>
    			<td>ID</td>
    			<td>投诉客户</td>
    			<td>投诉人</td>
    			<td>受理人</td>
    			<td>投诉日期</td>
    			<td>处理状态</td>
    			<td>详细信息</td>
    			<td>修改</td>
    			<td>删除</td>
    		</tr>
    	</thead>
    	<tbody>
    		<s:iterator value="complains" var="complain">
	    		<tr>
	    			<td><input type="checkbox" name="complainIds" value="<s:property value='#complain.id' />" /></td>
	    			<td><s:property value="#complain.id" /></td>
	    			<td><s:property value="#complain.customerInfo.name" /></td>
	    			<td><s:property value="#complain.complainant" /></td>
	    			<td><s:property value="#complain.user.name" /></td>
	    			<td><s:property value="#complain.time" /></td>
	    			<td><s:property value="#complain.state.name" /></td>
	    			<td><input type="button" style="background: url('img/detail.png');" class="showDetailStyle" onclick="showDetailDialog(${complain.id})" /></td>
	    			<td><input type="button" style="background: url('img/edit.png');" class="littleLogo" onclick="showUpdateDialog(${complain.id})" /></td>
	    			<td><input type="button" style="background: url('img/del.png');" class="littleLogo" onclick="delComplain(${complain.id})" /></td>
	    		</tr>
    		</s:iterator>
    	</tbody>
    	<tfoot>
    		<tr>
    			<td colspan="10">
    				<ul>
    					<!-- 设定每页显示记录数 -->
    					<li>
    						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;条/页
	    					<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest( 10 , true)" >10</a>
			    				</s:if>
			    				<s:else>
				    				<a href="Complain_list.action?pageSize=10">10</a>
			    				</s:else>
	    					</span>
		    				<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest( 15 , true)" >15</a>
			    				</s:if>
			    				<s:else>
				    				<a href="Complain_list.action?pageSize=15">15</a>
			    				</s:else>
		    				</span>
    					</li>
    					<!-- 设定每页显示记录数 -->
    					
    					<!-- 分页超链接 -->
    					<li>
    					<s:if test="#request.flag == true">
    						<a href="#" onclick="return pageRequest( ${page.pageCount} , false)" >尾页</a>
    					</s:if>
    					<s:else>
    						<a href="Complain_list.action?pageNumber=${ page.pageCount }">尾页</a>
    					</s:else>
    					</li>
    					<s:if test="page.hasNext">
	    					<li>
	    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( ${page.pageNumber + 1} , false)" >下一页</a>
	    					</s:if>
	    					<s:else>
	    						<a href="Complain_list.action?pageNumber=${ page.pageNumber + 1 }">下一页</a>
	    					</s:else>
	    					</li>
    					</s:if>
    					<s:if test="page.hasPre">
	    					<li>
	    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( ${page.pageNumber - 1} , false)" >上一页</a>
	    					</s:if>
	    					<s:else>
	    						<a href="Complain_list.action?pageNumber=${ page.pageNumber - 1 }">上一页</a>
	    					</s:else>
	    					</li>
    					</s:if>
    					<li>
    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( 1 , false)" >首页</a>
    					</s:if>
    					<s:else>
    						<a href="Complain_list.action?pageNumber=1">首页</a>
    					</s:else>
    					</li>
    					<!-- 分页超链接 -->
    					
    					<!-- 页面信息显示 -->
   						<li class="tfootContStyle"><input type="button" value="批量删除" onclick="delSelectedComplains()" /></li>
    					<li class="tfootContStyle"><span>共&nbsp;<s:property value="page.pageCount" />&nbsp;页,&nbsp;<s:property value="page.recordCount" />&nbsp;条记录,这是第&nbsp;<s:property value="page.pageNumber" />&nbsp;页</span></li>
		    			<li class="tfootContStyle"><span>此页显示第&nbsp;<s:property value="page.beginIndex + 1" />&nbsp;条到第&nbsp;<s:property value="page.endIndex" />&nbsp;条记录</span></li>
    					<!-- 页面信息显示 -->
    				</ul>
    			</td>
    		</tr>
    	</tfoot>
    </table>
    <div style="margin-top: 10px; float: right;">
	    <a href="Complain_exportExcel.action" >导出为Excel文件</a>
	    <a href="Complain_exportExcelPage.action?pageNumber=${ page.pageNumber }" >导出当前页为Excel文件(不包括查询结果)</a>
    </div>
  </body>
</html>
